Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cli): Improve error message for attempting genesis with non-empty config dir #4987

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

Alex6323
Copy link
Contributor

@Alex6323 Alex6323 commented Jan 23, 2025

Description of change

Ports the error message of MystenLabs/sui#19487

Deviates from the upstream PR and does fix some very small issues not worth a dedicated PR that are closely related to the intent of this PR. Upstream ignores errors produced by the genesis fn, and assumes a single reason for it to fail in that particular code path. Some reasons for it to fail are still possible though, so the actual error would be hidden from the user, which is not ideal.

How the change was tested

Ran iota start with a non-empty config directory by renaming network.yaml to something else, which triggers that code path.

Links to any relevant issues

fixes #4926

Copy link

vercel bot commented Jan 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
apps-backend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 7, 2025 9:18am
rebased-explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 7, 2025 9:18am
wallet-dashboard ✅ Ready (Inspect) Visit Preview Feb 7, 2025 9:18am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
apps-ui-kit ⬜️ Ignored (Inspect) Visit Preview Feb 7, 2025 9:18am

@iota-ci iota-ci added dev-tools Issues related to the Developer Tools Team sc-platform Issues related to the Smart Contract Platform group. labels Jan 23, 2025
@@ -949,11 +954,7 @@ async fn genesis(
// create default IOTA config dir if not specified
// on the command line and if it does not exist
// yet
None => {
let config_path = iota_config_dir()?;
fs::create_dir_all(&config_path)?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because iota_config_dir() already does it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev-tools Issues related to the Developer Tools Team sc-platform Issues related to the Smart Contract Platform group.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chore(iota): better error message when a iota config folder exists without genesis metadata
5 participants